<extend name="Public/base" />

<block name="body">
    
	<div class="row">
        <div class="col-md-12">
            
            <div class="tabbable tabbable-custom boxless">
                <form id="form" action="{:U('saveAction')}" method="post" class="form-1">
                <div class="tab-content">
                    
                        <div class="portlet box <if condition="ACTION_NAME eq 'addaction'">blue<else/>red</if>">
                            <div class="portlet-title">
                                <div class="caption"><i class="fa fa-reorder"></i> <if condition="ACTION_NAME eq 'addaction'">新增<else/>编辑</if>行为 </div>
                                <div class="tools">
                                    <a href="javascript:;" class="collapse"></a>
                                    <a href="#portlet-config" data-toggle="modal" class="config"></a>
                                    <a href="javascript:;" class="reload"></a>
                                    <a href="javascript:;" class="remove"></a>
                                </div>
                            </div>
                            <div class="portlet-body form">
                                <!-- BEGIN FORM-->
                                
                                    <div class="form-body">
                                        <div class="form-group">
                                            <label>行为标识<span class="check-tips">（输入行为标识 英文字母）</span></label>
                                    
                                            <input type="text" class="form-control input-medium" name="name" value="{$data.name}">
                                        </div>
                                        <div class="form-group">
                                            <label>行为名称<span class="check-tips">（输入行为名称）</span></label>
                                    
                                            <input type="text" class="form-control input-medium" name="title" value="{$data.title}">
                                        </div>	
                                        <div class="form-group">
                                            <label>行为类型<span class="check-tips">（选择行为类型）</span></label>
                                    
                                            <select class="form-control input-medium" name="type">
                                                <volist name=":get_action_type(null,true)" id="vo">
                                                    <option value="{$key}">{$vo}</option>
                                                </volist>
                                            </select>
                                        </div>	
                                        <div class="form-group">
                                            <label>行为描述<span class="check-tips">（输入行为描述）</span></label>
                                            <textarea class="form-control input-xlarge" rows="3"  name="remark" >{$data.remark}</textarea>
                                        </div>
                                        <div class="form-group">
                                            <label>行为规则<span class="check-tips">（输入行为规则，不写则只记录日志）</span></label>
                                            <textarea class="form-control input-xlarge" rows="3"  name="rule" >{$data.rule}</textarea>
                                        </div>
                                        <div class="form-group">
                                            <label>日志规则<span class="check-tips">（记录日志备注时按此规则来生成，支持[变量|函数]。目前变量有：user,time,model,record,data）</span></label>
                                            <textarea class="form-control input-xlarge" rows="3"  name="log" >{$data.log}</textarea>
                                        </div>

                                    </div>
                                    
                                    
                                    <div class="form-actions fluid ">
                                        <div class="col-md-offset-3 col-md-9">
                                            <input type="hidden" name="id" value="{$data.id}"/>
                                            <button type="submit" class="btn green submit-btn ajax-post" target-form="form-1">确 定</button>
                                            <button class="btn default btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
                                        </div>
                                    </div>
                                
                                <!-- END FORM--> 
                            </div>
                        </div>
                        
                </div>
                
                </form>
            </div>
        </div>
    </div>
</block>

<block name="script">
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="__STATIC__/scripts/app.js"></script>
	<!-- END PAGE LEVEL SCRIPTS -->
	<script>
	jQuery(document).ready(function() {       
		// initiate layout and plugins
		App.init();

        highlight_subnav('{:U('User/action')}');
	});
	</script>
</block>
